/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package models;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import tableModels.TableCircuitModel;
import utils.TableModel;

/**
 *
 * @author juju
 */
public class Circuit {
    protected int _Identifiant;
    protected String _Descriptif;
    protected String _VilleDepart;
    protected String _PaysDepart;
    protected String _VilleArrivee;
    protected String _PaysArrivee;
    protected String _DateDepart;
    protected int _NbrPlaceDisponible;
    protected int _Duree;
    protected int _PrixInscription;
    private CircuitMapper mapper;
    
    public Circuit() {
        this.mapper = new CircuitMapper();
    }

    public int getIdentifiant() {
        return _Identifiant;
    }

    public void setIdentifiant(int _Identifiant) {
        this._Identifiant = _Identifiant;
    }

    public String getDescriptif() {
        return _Descriptif;
    }

    public void setDescriptif(String _Descriptif) {
        this._Descriptif = _Descriptif;
    }

    public String getVilleDepart() {
        return _VilleDepart;
    }

    public void setVilleDepart(String _VilleDepart) {
        this._VilleDepart = _VilleDepart;
    }

    public String getPaysDepart() {
        return _PaysDepart;
    }

    public void setPaysDepart(String _PaysDepart) {
        this._PaysDepart = _PaysDepart;
    }

    public String getVilleArrivee() {
        return _VilleArrivee;
    }

    public void setVilleArrivee(String _VilleArrivee) {
        this._VilleArrivee = _VilleArrivee;
    }

    public String getPaysArrivee() {
        return _PaysArrivee;
    }

    public void setPaysArrivee(String _PaysArrivee) {
        this._PaysArrivee = _PaysArrivee;
    }

    public String getDateDepart() {
        return _DateDepart;
    }

    public void setDateDepart(String _DateDepart) {
        this._DateDepart = _DateDepart;
    }

    public int getNbrPlaceDisponible() {
        return _NbrPlaceDisponible;
    }

    public void setNbrPlaceDisponible(int _NbrPlaceDisponible) {
        this._NbrPlaceDisponible = _NbrPlaceDisponible;
    }

    public int getDuree() {
        return _Duree;
    }

    public void setDuree(int _Duree) {
        this._Duree = _Duree;
    }

    public int getPrixInscription() {
        return _PrixInscription;
    }

    public void setPrixInscription(int _PrixInscription) {
        this._PrixInscription = _PrixInscription;
    }
    
    public TableCircuitModel fetchAll() {
        return mapper.fetchAll();
    }
    
     public void save() {
        mapper.save(this);
    }
     
     public void find(int id) {
        try {
            this.mapper.find(id, this);
        } catch (SQLException ex) {
            Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
